package com.example.baidupushtest;

import android.app.Activity;
import android.os.Bundle;

import com.baidu.android.pushservice.PushConstants;
import com.baidu.android.pushservice.PushManager;

public class MainActivity extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		MyApplication application = (MyApplication) getApplication();
		if (application.isFirst()) {
			PushManager.startWork(this, PushConstants.LOGIN_TYPE_API_KEY, MyApplication.API_KEY);
			application.setFirst(false);
		}
		application.getUserId();
	}
}